﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NKnife.IoC;

namespace InfoboardAdapterC.Common
{
    public class ParamentConfig
    {
        private readonly IniFileConfig _IniFile = DI.Get<IniFileConfig>();

        /// <summary>
        /// 保存时间配置
        /// </summary>
        /// <param name="timeTick"></param>
        public void SaveConfigTimer(string timeTick)
        {
            _IniFile.IniWriteValue(nameof(ParamentConfig), nameof(timeTick), timeTick);
        }
        /// <summary>
        /// 读取时间配置
        /// </summary>
        /// <param name="timeTick"></param>
        public void LoadConfigTimer(out string timeTick)
        {
            timeTick = _IniFile.IniReadValue(nameof(ParamentConfig), nameof(timeTick));
        }

        /// <summary>
        /// 保存连接配置
        /// </summary>
        /// <param name="connection"></param>
        public void SaveConnectio(string connection)
        {
            _IniFile.IniWriteValue(nameof(ParamentConfig), nameof(connection), connection);
        }
        /// <summary>
        /// 读取连接配置
        /// </summary>
        /// <param name="connection"></param>
        public void LoadConnectio(out string connection)
        {
            connection = _IniFile.IniReadValue(nameof(ParamentConfig), nameof(connection));
        }
    }
}

